/**
 * 
 */
package com.bitBusy.manageyourriches.utilityClasses.navigation;

import android.app.Activity;
import android.content.Intent;

import com.bitBusy.manageyourriches.R;
import com.bitBusy.manageyourriches.activity.AlarmActivity;
import com.bitBusy.manageyourriches.activity.ExportDataActivity;
import com.bitBusy.manageyourriches.activity.HomeActivity;
import com.bitBusy.manageyourriches.activity.ViewExpensesActivity;
import com.bitBusy.manageyourriches.activity.ViewGraphReportActivity;

/**
 * @author SumaHarsha
 *
 */
public class ActionBarChoice {
	
	
	/** method to navigate based on choice
	 * @param context
	 * @param choice
	 */
	public static void choiceMade(Activity the_currActivity, int the_choice)
	{
		if (the_currActivity != null)
		{
			switch (the_choice) {
		    case android.R.id.home:
		    {
		    	  if (!the_currActivity.getClass().equals(HomeActivity.class))
		    	  {
			    	  Intent intent = new Intent(the_currActivity, HomeActivity.class);
			    	  intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
			    	  the_currActivity.startActivity(intent);
		    	  }
			    	  break; 
			    }
		
		     case R.id.action_viewExpenses:
		    {
		    	 if (!the_currActivity.getClass().equals(ViewExpensesActivity.class))
		    	  {
			      	Intent intent = new Intent(the_currActivity, ViewExpensesActivity.class);
			      	the_currActivity.startActivity(intent);
		    	  }
			      break;
		    }
		    case R.id.action_viewReports:
		    {
		    	 if (!the_currActivity.getClass().equals(ViewGraphReportActivity.class))
		    	  {
			 
			       	Intent intent = new Intent(the_currActivity, ViewGraphReportActivity.class);	    
			       	the_currActivity.startActivity(intent);
		    	  }
			      break;
		    }
		    case R.id.action_setAlarm:
		    {
		    	 if (!the_currActivity.getClass().equals(AlarmActivity.class))
		    	  {
				 	Intent intent = new Intent(the_currActivity, AlarmActivity.class);
			    	the_currActivity.startActivity(intent);
		    	  }
			     	break;

		    }
		    case R.id.action_exportData:
		    {
		    	 if (!the_currActivity.getClass().equals(ExportDataActivity.class))
		    	  {
			     	Intent intent = new Intent(the_currActivity, ExportDataActivity.class);
			     	the_currActivity.startActivity(intent);

		    	  }
			     	break;

		    }
		  
		    default:
		      break;
		    }
		}
	}

}
